using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MonsterController : MonoBehaviour
{
    public float speed = 10f;
    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("Move", 1f, 1f);
    }

    // Update is called once per frame
    void Update()
    {
        transform.Translate(speed * Time.deltaTime, 0, 10 * Time.deltaTime);
    }

    void Move()
    {
        speed *= -1;
    }
}
